package com.itheima.user.sentinel.fallback;

import com.alibaba.fastjson.JSON;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 全局默认的返回
 */
@Component
public class GlobalFallBackHandler {

    public static String fallbackHandler(int flag){

        Map map = new HashMap();
        map.put("code", 429);
        map.put("message", "网络异常，请稍后尝试 GlobalFallBackHandler");

        return JSON.toJSONString(map);
    }
}
